package com.bjpowernode.boss.convert;

import com.bjpowernode.boss.mvc.models.vo.UserPayConfigVo;
import com.bjpowernode.boss.persist.domain.UserPayConfig;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.MappingConstants;
import org.mapstruct.Mappings;

import java.util.List;

@Mapper(componentModel = MappingConstants.ComponentModel.SPRING,
        uses = {CommonFun.class})
public interface UserConfigConvert {

    @Mappings({
            @Mapping(target = "editTime", source = "editTime", dateFormat = "yyyy-MM-dd HH:mm:ss"),
            @Mapping(target = "status", source = "status", qualifiedByName = "translateStatus"),
            @Mapping(target = "productCode", source = "payProductCode"),
            @Mapping(target = "productName", source = "payProductName"),
            @Mapping(target = "autoSett", source = "autoSett",qualifiedByName = "translateAutoSet")
    })
    UserPayConfigVo userPayConfigToVo (UserPayConfig userPayConfig);

    List<UserPayConfigVo> userPayConfigListToVoList (List<UserPayConfig> userPayConfig);

}
